angular.module('starter.router', []).config(function ($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider, $ocLazyLoadProvider) {
		$stateProvider
        .state('subway', {
            url: '/subway',
            data: {pageTitle: '地铁线路'},
            templateUrl: 'templates/subway.html',
            params: {transData: {}},
            cache : false,
            controller: 'subwayController',
            resolve: {
                deps: ['$ocLazyLoad', function($ocLazyLoad) {
                    return $ocLazyLoad.load({
                        name: 'starter',
                        insertBefore: '#ng_load_plugins_before',
                        files: [
                            'js/controllers/subwayController.js'
                        ]
                    });
                }]
            }
        })
        
        
        .state('lineAdjustNoticeList', {
            url: '/lineAdjustNoticeList',
            data: {pageTitle: '线路调整公告列表'},
            templateUrl: 'templates/lineAdjustNoticeList.html',
            params: {transData: {}},
            cache : false,
            controller: 'lineAdjustNoticeListController',
            resolve: {
                deps: ['$ocLazyLoad', function($ocLazyLoad) {
                    return $ocLazyLoad.load({
                        name: 'starter',
                        insertBefore: '#ng_load_plugins_before',
                        files: [
                            'js/controllers/lineAdjustNoticeListController.js'
                        ]
                    });
                }]
            }
        })
        
         .state('lineAdjustNoticeDetail', {
            url: '/lineAdjustNoticeDetail',
            data: {pageTitle: '线路调整公告详情'},
            templateUrl: 'templates/lineAdjustNoticeDetail.html',
            params: {transData: {}},
            cache : false,
            controller: 'lineAdjustNoticeDetailController',
            resolve: {
                deps: ['$ocLazyLoad', function($ocLazyLoad) {
                    return $ocLazyLoad.load({
                        name: 'starter',
                        insertBefore: '#ng_load_plugins_before',
                        files: [
                            'js/controllers/lineAdjustNoticeDetailController.js'
                        ]
                    });
                }]
            }
        })
        
        .state('error', {
            url: '/error',
            data: {pageTitle: '页面错误'},
            templateUrl: 'templates/error.html',
            params: {},
            cache : false
        })

    ;

    // if none of the above states are matched, use this as the fallback
    // $urlRouterProvider.otherwise('/login');
    $urlRouterProvider.otherwise(function ($injector, $location) {
        $location.path('/error');
    });
});
    
